

#celery启动文件
from celery import Celery

#创建celery实例 参数是别名没有实际意思
celery_app = Celery('meiduo_03')

# 为celery使用django配置文件进行设置
import os
if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'meiduo_mall.settings.dev'

#加载配置
celery_app.config_from_object('celery_tasks.config')

#指定异步任务
celery_app.autodiscover_tasks(['celery_tasks.sms','celery_tasks.email','celery_tasks.html'])
# celery_app.autodiscover_tasks(['celery_tasks.sms','celery_tasks.email','celery_tasks.html'])